<?#//v.3.1.1
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2007 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('../includes/config.inc.php');
include "loggedin.inc.php";
       include('../online.php');
unset($ERR);

#//
if($_POST[action] == "update" && phpa_securepost($_POST))
{
    if(!isset($_POST[accesses]) && !isset($_POST[browsers]) && !isset($_POST[domains])) {
        $ERR = $ERR_5002;
        $SETTINGS = $_POST;
    } else {
        if(!isset($_POST[accesses])) $_POST[accesses] = 'n';
        if(!isset($_POST[browsers])) $_POST[browsers] = 'n';
        if(!isset($_POST[domains])) $_POST[domains] = 'n';
        #// Update database
        $query = "update PHPAUCTIONXL_statssettings set
                      activate='$_POST[activate]',
                      accesses='$_POST[accesses]',
                      browsers='$_POST[browsers]',
                      domains='$_POST[domains]'";
        $res = @mysql_query($query);
        if(!$res)
        {
            print "Error: $query<BR>".mysql_error();
            exit;
        }
        else
        {
            $ERR = $MSG_5148;
            $SETTINGS = $_POST;
        }
    }
} else {
    #//
    $query = "SELECT * FROM PHPAUCTIONXL_statssettings";
    $res = @mysql_query($query);
    if(!$res) {
        print "Error: $query<BR>".mysql_error();
        exit;
    } elseif(mysql_num_rows($res) > 0) {
        $SETTINGS = mysql_fetch_array($res);
    }
}

?>
<HTML>
<HEAD>
<link rel='stylesheet' type='text/css' href='style.css' />
<link href="css/main.css" rel="stylesheet" type="text/css">
<SCRIPT Language=Javascript>
function window_open(pagina,titulo,ancho,largo,x,y){
        var Ventana= 'toolbar=0,location=0,directories=0,scrollbars=1,screenX='+x+',screenY='+y+',status=0,menubar=0,resizable=0,width='+ancho+',height='+largo;
        open(pagina,titulo,Ventana);
}
</SCRIPT>

</HEAD>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titulo">
        <tr> 
          <td class="icono"><img src="images/stats_icon2.gif" width="34" height="26" ></td>
          <td class="breadcrumbs">
         <p> <span><?=$MSG_AJAX_ADMIN_HEADING_REPORTS?></span>&nbsp;&gt;&gt;&nbsp;<?=$MSG_5142?></p></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
    <tr> 
    <td align="center" valign="middle">
<TABLE BORDER=0 WIDTH=95% CELLPADDING=0 CELLSPACING=0 BGCOLOR="#FFFFFF">
<TR>
<TD>
<CENTER>
    <BR>
    <FORM NAME=conf ACTION=<?=basename($_SERVER['PHP_SELF'])?> METHOD=POST>
        <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" class="base" style="border:1px solid #ccc;">
            <TR>
                <TD class="title">
                  <p>  <? print $MSG_AJAX_ADMIN_REPORTS_USERS_ONLINE; ?></p>
                    </TD>
            </TR>
            <TR>
                <TD>
    <TABLE WIDTH=100% ALIGN="CENTER" CELLPADDING=0 cellspacing="0" BGCOLOR="#FFFFFF">
      <?
      if(isset($ERR))
      {
      ?>
      <TR>
        <TD COLSPAN="2" class="error"><p>
          <? print $ERR; ?>
          </p></TD>
      </TR>
      <?
      }
                     ?>
      <TR VALIGN="TOP">
           
        
        
      <TR VALIGN="TOP">
        <TD WIDTH=125 HEIGHT="22" class="lineV">
         
         </TD>
        <TD WIDTH="375" HEIGHT="22"><FONT FACE="Verdana, Verdana, Arial, Helvetica, sans-serif" SIZE="+2">
         <? print "There have been <font color=red>$count15min</font> users in the last 30 minutes"; ?>
          </FONT></TD>
      </TR>
          
    </TABLE>
    </TD>
    </TR>
    </TABLE>
    </FORM>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
